package cn.minsh.lims.eoms.modules.app.enums;

import lombok.Getter;

/**
 * @author Administrator
 */

@Getter
public enum FrequencyEnum {
    DAY(1,"日"),
    WEEK(2,"周"),
    MONTH(3,"月"),
    YEAR(4,"年") ,
    NO_REPEAT(5,"不重复"),
    WORKING(6,"工作日") ;

    private Integer code ;
    private String desc ;
    FrequencyEnum(Integer code,String desc){
        this.code = code ;
        this.desc = desc ;
    }

    public static FrequencyEnum valueOf(Integer code){
        for (FrequencyEnum frequencyEnum : values()){
            if (frequencyEnum.getCode().equals(code)){
                return frequencyEnum ;
            }
        }
        return null ;
    }

    public static String getDesc(Integer code){
        for (FrequencyEnum frequencyEnum : values()){
            if (frequencyEnum.getCode().equals(code)){
                return frequencyEnum.getDesc() ;
            }
        }
        return null ;
    }
}
